<template>
   <div>
    <div class="footer_wrap">
      <!-- <a href="#/find">发现音乐</a>
        <a href="#/my">我的音乐</a>
          <a href="#/part">朋友</a> -->
          <!-- router-link最终渲染成a标签,会自动加 -->
          <!-- 1.声明式传参
          query传参
          传递 在路径上使用 ? 参数1=值1&参数2=值2
          用 $route.query接收
          -->
<!-- 2.动态路径传参
    动态路径必须在路由配置是提前写好
       传递:在路径是/值
       接收:$route.params/值 -->
      <span @click="go('/find', 'find')">发现音乐</span>
       <span @click="goAttr('/find', 'find')">发现音乐===</span>
      <span @click="go('/my', 'my')">我的音乐</span>
      <span @click="go('/part', 'part')">朋友</span>
      <!-- <span @click="go('/find','find')">404</span> -->
    </div>
    <div class="top">
      <router-view />
    </div>
   </div>
</template>

<script>

export default {
  methods:{
    goAttr(path,name){
      this.$router.push({
        path,
        query:{
          name:'饶',
          age:333
        }
      })
    },
    go(path,name){
      this.$router.push({
        name
      })
    }
  }

};
</script>

<style  scoped>
.footer_wrap {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  width: 100%;
  text-align: center;
  background-color: #333;
  color: #ccc;
}
.footer_wrap a, span {
  flex: 1;
  text-decoration: none;
  padding: 20px 0;
  line-height: 20px;
  background-color: #333;
  color: #ccc;
  border: 1px solid black;
  cursor: pointer;
}
.footer_wrap a:hover, span:hover {
  background-color: #555;
}
.top {
  padding-top: 62px;
}
.active {
  background-color: #000 !important;
}
</style>